import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) { 
            int count = 0;
            int n = in.nextInt();
            while(n != 0){
                if((n & 1) == 1){
                    count++;
                }
                n >>= 1;
            }
            System.out.println(count);
        }
    }
}

